From: Kenichi Handa Date: Thu, 16 Apr 2009 01:39:08 +0000 (+0000) Subject: (xfont_has_char): Special handling of `ja' and `ko' adstyle. X-Git-Tag: archive/raspbian/1%29.2+1-2+rpi1~1^2~421^2~821 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:///%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:/?a=commitdiff_plain;h=eddca531639ebbced1e30d19a77be2eaad0634d7;p=emacs.git (xfont_has_char): Special handling of `ja' and `ko' adstyle. --- diff --git a/src/xfont.c b/src/xfont.c index bae63ac8555..6d0e8d91127 100644 --- a/src/xfont.c +++ b/src/xfont.c @@ -792,17 +792,33 @@ xfont_prepare_face (f, face) return 0; } +extern Lisp_Object Qja, Qko; + static int -xfont_has_char (entity, c) - Lisp_Object entity; +xfont_has_char (font, c) + Lisp_Object font; int c; { - Lisp_Object registry = AREF (entity, FONT_REGISTRY_INDEX); + Lisp_Object registry = AREF (font, FONT_REGISTRY_INDEX); struct charset *encoding; - struct charset *repertory; - - if (font_registry_charsets (registry, &encoding, &repertory) < 0) - return -1; + struct charset *repertory = NULL; + + if (EQ (registry, Qiso10646_1)) + { + /* We use a font of `ja' and `ko' adstyle only for a character + in JISX0208 and KSC5601 charsets respectively. */ + if (EQ (AREF (font, FONT_ADSTYLE_INDEX), Qja) + && charset_jisx0208 >= 0) + encoding = repertory = CHARSET_FROM_ID (charset_jisx0208); + else if (EQ (AREF (font, FONT_ADSTYLE_INDEX), Qko) + && charset_ksc5601 >= 0) + encoding = repertory = CHARSET_FROM_ID (charset_ksc5601); + else + encoding = CHARSET_FROM_ID (charset_unicode); + } + else if (font_registry_charsets (registry, &encoding, &repertory) < 0) + /* Unknown REGISTRY, not usable. */ + return 0; if (ASCII_CHAR_P (c) && encoding->ascii_compatible_p) return 1; if (! repertory)